package evolutionaryballoons.behavior;

import java.util.Random;

import evolutionaryballoons.Balloon;

public class RandomBehavior implements Behavior {
	private Balloon balloon;
	private boolean burnerOn;
	private Random random;
	private int tick;
	
	public RandomBehavior(Balloon balloon) {
		this.balloon = balloon;
		this.burnerOn = false;
		this.random = new Random();
		this.tick = 0;
	}
	
	@Override
	public void act() {
		balloon.burnerOn = burnerOn;
		
		tick = (tick + 1) % 20;
		
		if (tick == 0) {
			burnerOn = random.nextBoolean();
		}
	}
}
